package com.dzk.cp.c11x5.listener.timer;

import java.util.Map;
import java.util.Timer;

import javax.annotation.PostConstruct;

import org.springframework.stereotype.Component;

import com.dzk.cp.c11x5.listener.BaseC11x5Listener;
import com.dzk.cp.c11x5.util.SpringBeanUtils;

@Component("c11x5TimerExecutor")
public class C11x5TimerExecutor {
	
	private static final Timer timer = new Timer();
	
//	@PostConstruct
	public void start() {
		Map<String, BaseC11x5Listener> map = SpringBeanUtils.getWebContext().getBeansOfType(BaseC11x5Listener.class);
		if (map != null && map.size() > 0) {
			for (BaseC11x5Listener task : map.values()) {
				timer.schedule(task, 60000, 600000);
			}
		}
	}

}
